import {
  postForm
}
from '../../../utils/request'
Page({

  data: {},

  onLoad(options) {
    let id = options.id || 80;
    this.setData({
      id: id
    })
    this.loadTrade();
    this.loadContactMe();
  },
  onReady() {},
  onShow() {},
  onHide() {},
  onUnload() {},
  onPullDownRefresh() {},
  onReachBottom() {},
  onShareAppMessage() {},
  loadTrade() {
    postForm({
      url: `front/api/trade/detail/${this.data.id}`
    }).then(resp => {
      this.setData({
        trade: resp.trade
      })
    })
  },
  loadContactMe() {
    postForm({
      url: 'front/api/wxwork/contact/get/default'
    }).then(res => {
      this.setData({
        configId: res.configId
      })
    })
  },
  clickCopy() {
    wx.setClipboardData({
      data: this.data.trade.tradeCode,
      success(res) {
        wx.getClipboardData({
          success(res) {
            console.log(res.data) // data
          }
        })
      }
    })
  }
})